package com.mybatis.quartz.job;

import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import java.text.SimpleDateFormat;
import java.util.Date;

@DisallowConcurrentExecution
public class Job1 extends QuartzJobBean {

    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) {
        //简单输出日期
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println("Job1---- Start" + sdf.format(new Date()));
        try {
            Thread.sleep(8000);
        }catch (Exception e){
            e.printStackTrace();
        }
        System.out.println("Job1---- ebd" + sdf.format(new Date()));
    }
}
